#ifndef KENOSQL_H
#define KENOSQL_H

#include "tracksql.h"

#define GAMEID_SIZE		16
typedef char GameID[GAMEID_SIZE];

class BonusBingoGame;
class BonusBingoGameResult;
class BonusBingoSubGame;

//
// All money values are in cents (100 == $1, 25 == $.25, 1 == $.01)
//
// IMPORTANT:  Access to this class is NOT thread-safe.  That's handled at
//			   the next level up (with calls to lock()/unlock()).
//

class BonusBingoSQL
{
	public:
		BonusBingoSQL(TrackSQL* tracker);

		int32 createGame(int32 casinoId,
			const PID& pid, bool8 forMoney, SESSIONID sessionid, int32 compFactor,
			GameID gid, int32 *balance, BonusBingoGame *bet, bool8 newGroup);

		int32 gameDone(int32 casinoId, const PID&, bool8 forMoney, GameID gid,
			int32 balanceAdjust, int32 *balance, int32 *comp, BonusBingoGameResult* results);

		int32 getPayTable(uint8 *paytable);

		int32 getPlayerLimits(const PID& pid, int32 gameId, uint8 machId,
				int32* compFactor);

		int32 getDenominations(int32 *DenomValues);

        int32 getSavedGame(const PID& pid, bool8 forMoney, GameID gameID, bool8* completed, 
                           BonusBingoGame*& game, BonusBingoGameResult*& result);

        int32 getSavedSubGame(const PID& pid, bool8 forMoney, BonusBingoSubGame*& subGameData);

        int32 updateSubGame(int32 casinoID, SESSIONID sessionID,
                            bool8 forMoney, BonusBingoSubGame* subGameData);

        inline void lock()   { tracker->lock(); } ;

        inline void unlock() { tracker->unlock(); } ;

    protected:
        TrackSQL*   tracker;
};

#endif
